home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.0-b / stk-3 / blt-for-STk-3.0 / Demos / htext.stk < prev    next >
Encoding:
Text File  |  1995-12-26  |  1.3 KB  |  45 lines

  1. ;; Some redefinition to make the demo working.
  2. ;; No care has been taken for trying to make this demo working well since
  3. ;; Tk 4.0 will enhance greatly the text widget. 
  4. ;; This is just for playing with the BLT hyper text widget.
  5. ;; If this widget is really needed, I could try to provide a better support
  6.  
  7. (set! *load-path* (cons ".." *load-path*))
  8. (require "blt")
  9.  
  10.  
  11. (define global list)            ;; Kludge
  12. (define blt_htext{line} #f)        ;; Kludge
  13. (define blt_htext{widget} '.htext)    ;; Kludge
  14. (define blt_htext{file} #f)        ;; Kludge
  15.  
  16.  
  17. (option 'add "*Blt_htext.foreground" "navyblue")
  18.  
  19. ;;; Create horizontal and vertical scrollbars
  20. (scrollbar '.vscroll :command (lambda l (apply .htext 'yview l)) :orient 'vertical)
  21. (scrollbar '.hscroll :command (lambda l (apply .htext 'xview l)) :orient 'horizontal)
  22.  
  23. ;;;; Create the hypertext widget 
  24. (blt_htext '.htext 
  25.        :file "./htext.txt"
  26.        :yscrollcommand (lambda l (apply .vscroll 'set l))
  27.        :xscrollcommand (lambda l (apply .hscroll 'set l))
  28.        :height '6i
  29.        :yscrollunits '10m
  30.        :xscrollunits '0.25i)
  31.  
  32. ;;;;
  33. ;;;; Use BLT_TABLE for placing widgets
  34. ;;;; 
  35. (blt_table *root*
  36.        .htext   "0,0" :fill 'both
  37.        .vscroll "0,1" :fill 'y
  38.        .hscroll "1,0" :fill 'x)
  39.  
  40. (blt_table 'row    *root* 'configure 1 :resize 'none)
  41. (blt_table 'column *root* 'configure 1 :resize 'none)
  42.  
  43. (wm 'maxsize *root* 1000 1000)
  44. (wm 'minsize *root* 0 0)
  45.